<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<head>
    <base href="<%=basePath%>">
    <title>添加商品</title>
    <link rel="stylesheet" href="assets/outerRes/css/bootstrap.css">
</head>
<body>
<form action="commodity/saveBaseInfo.do" method="post" role="form" enctype="multipart/form-data"
      class="col-sm-4 col-sm-offset-4">
    <div class="form-group">
        <label for="price">单价</label>
        <input type="text" class="form-control" id="price" name="price"
               placeholder="请输入单价">
    </div>
    <div class="form-group">
        <label for="unit">单位</label>
        <input type="text" class="form-control" id="unit" name="unit"
               placeholder="请输入单价的单位">
    </div>
    <div class="form-group">
        <label for="baseInfoDescription">基本描述</label>
        <textarea class="form-control" rows="3" id="baseInfoDescription" name="baseInfoDescription"></textarea>
    </div>
    <div class="form-group">
        <label for="photo">照片</label>
        <input type="file" id="photo" name="photo">
    </div>
    <div class="form-group">
        <label for="commodityType">商品类型</label>
        <select class="form-control" id="commodityType" name="commodityType">
            <c:forEach items="${commodityTypeList}" var="item">
                <option value="${item.id}">${item.typeName}</option>
            </c:forEach>
        </select>
    </div>
    <div class="form-group">
        <label for="provinceInfo">所属省份</label>
        <select class="form-control" id="provinceInfo" name="provinceInfo">
            <c:forEach items="${provinceList}" var="item">
                <option value="${item.id}">${item.provinceName}</option>
            </c:forEach>
        </select>
    </div>
    <div class="form-group">
        <button type="submit" class="btn btn-default">提交</button>
        <button id="abandonAndReturn" type="submit" class="btn btn-default">放弃并返回</button>
    </div>
</form>

<input id="basePath" type="hidden" value="<%=basePath%>"/>
<script src="assets/outerRes/js/jquery-3.0.0.js"></script>
<script src="assets/outerRes/js/bootstrap.js"></script>
<script src="assets/innerRes/js/addCommodityBaseInfo.js"></script>
<script>
    $(function () {
        addCommodityBaseInfo.init();
    });
</script>
</body>
</html>
